import instance from "../utils/axios_config.js";

export {getUserPage, queryUser, queryUserById, banUser, unbanUser, editUser}
// 查询列表接口
const getUserPage = (params) => {
    return instance({
        url: '/user/list',
        method: 'get',
        params
    })
}
// 条件查询用户列表
const queryUser = (params) => {
    return instance({
        url: `/user/list`,
        method: 'post',
        data: {...params}
    })
}

// 编辑页面反查详情接口
const queryUserById = (id) => {
    return instance({
        url: `/user/` + id,
        method: 'get',
    })
}

// 封禁用户接口
const banUser = (id) => {
    return instance({
        url: '/user/ban/' + id,
        method: 'get'
    })
}

// 解封用户接口
const unbanUser = (id) => {
    return instance({
        url: '/user/unban/' + id,
        method: 'get'
    })
}

// 修改接口
const editUser = (params) => {
    return instance({
        url: '/user',
        method: 'put',
        data: {...params}
    })
}
